The present invention relates to graphics processing in a computer system, more particularly to a method and system for more efficiently rendering a graphical image.
A conventional computer graphics system can display a graphical image on a display. The graphical image typically includes a plurality of objects. The display includes a plurality of display elements, known as pixels, typically arranged in a grid. In order to display objects, the conventional computer graphics system typically breaks the objects into a plurality of polygons. The conventional system then typically renders the polygons in a particular order. For a three-dimensional scene, the polygons are generally rendered from back to front as measured from the viewing plane of the display. Similarly, a two-dimensional scene can be displayed where polygons are rendered based on their layer. Shallower layers occlude deeper layers.
In order to render the graphical image conventional systems typically render the plurality of objects polygon by polygon. Typically, a display list is built. The display list provides the polygons in the order in which the polygons are to be rendered. The a conventional graphics system then typically renders a first polygon on the display list, regardless of the number or locations of pixels the polygon intersects. The data for pixels in the polygon are typically rendered from left to right and top to bottom in the polygon. The conventional system continues rendering the graphical image, polygon by polygon, until all polygons have been rendered. In another conventional system, tiles are rendered. A tile is typically a two dimensional square containing nxc3x97n pixels. In order to render the tile, the pixels are rendered from left to right and top to bottom in the tile.
Although these conventional methods function, one of ordinary skill in the art will readily realize that it is desirable to provide data for an image in raster order. Furthermore, it would desirable if the image is efficiently rendered.
Accordingly, what is needed is a system and method for more efficiently rendering a graphical image. The present invention addresses such a need.
The present invention provides a method and system for providing a graphical image on a display. The display includes a plurality of pixels. The data includes a plurality of fragments for the at least one object. The plurality of fragments intersects a first portion of the plurality of pixels. The method and system comprise defining a plurality of macro-pixels. Each of the plurality of macro-pixels includes a second portion of the plurality of pixels. The second portion of the plurality of pixels are adjacent and include n pixels of the second portion of the plurality of pixels in a first direction and m pixels of the second portion of the plurality of pixels in a second direction. The method and system further comprise rendering the plurality of pixels by rendering a plurality of macro-pixels in raster order. In one aspect, each macro-pixel is rendered by rendering the second portion of the plurality of pixels pixel by pixel. Each of the second portion of the plurality of pixels is rendered by rendering the fragments intersecting the pixel. In another aspect, each macro-pixel is rendered by rendering macro-fragments intersecting the macro-pixel. Each macro-fragment intersecting a macro-pixel includes the fragments for a particular polygon that intersect the macro-pixel. The data is then output pixel by pixel. An output for each pixel includes a first portion of the plurality of fragments that intersect the pixel.
According to the system and method disclosed herein, the present invention provides the graphical image while taking into account coherency that may exist between pixels in multiple dimensions. Thus, operations such as texture mapping or caching may be more efficient.